package com.atguigu.shardingjdbcdemo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;

/**
 * className: Order
 * description:
 * date: 2024/6/11-19:22
 * <p>
 * project: ShardingSphere5
 * package: com.atguigu.shardingjdbcdemo.entity
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
@TableName("t_order")
@Data
public class Order {

    // 当配置了shardingsphere-jdbc的分布式序列时，自动使用shardingsphere-jdbc的分布式序列
// 当没有配置shardingsphere-jdbc的分布式序列时，自动依赖数据库的主键自增策略
    @TableId(type = IdType.AUTO)
    // @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    private String orderNo;
    private Long userId;
    private BigDecimal amount;
}
